<!--原料档案模块-->
<template>
  <div  style="position: relative;">
    <mmTable ref="mmTable" :mmColumns="columns" :getUrl="url" :updateUrl="updateUrl" :delUrl="delUrl"
             :form="form" :formData="formData" v-on:formDataChange="formDataChange"
             :searchFormData="searchFormData" :searchForm="searchForm"
             :modalWidth="950">
      <Form slot="searchForm" ref="searchForm" :model="searchFormData" inline :label-width="70"  style="float: left">
        <FormItem label="用户名" prop="">
          <Input v-model="searchFormData.name" type="text" placeholder="" />
        </FormItem>
      </Form>
      <!--编辑添加模态框-->
      <Form  slot="editForm" :label-width="100" :model="formData" inline ref="editForm" :rules="formValidate">

        <Row>
          <Col :span="8">
          <FormItem label="编号" prop="code" style="width:300px">
            <Input v-model="formData.code" type="text"  />
          </FormItem>
          </Col>
          <Col :span="8">
          <FormItem label="方案名" prop="name" style="width:300px">
            <Input v-model="formData.name" type="text"  />
          </FormItem>
          </Col>
          <Col :span="8">
          <FormItem label="水份上限" prop="moistureup" style="width:300px">
            <Input v-model="formData.moistureup" type="text"  />
          </FormItem>
          </Col>
        </Row>
        <Row>
          <Col :span="8">
          <FormItem label="挥发份上限" prop="volatileup" style="width:300px">
            <Input v-model="formData.volatileup" type="text"  />
          </FormItem>
          </Col>
          <Col :span="8">
          <FormItem label="挥发份下限" prop="volatiledown" style="width:300px">
            <Input v-model="formData.volatiledown" type="text"  />
          </FormItem>
          </Col>
          <Col :span="8">
          <FormItem label="灰份上限" prop="ashup" style="width:300px">
            <Input v-model="formData.ashup" type="text"  />
          </FormItem>
          </Col>
        </Row>
        <Row>
          <Col :span="8">
          <FormItem label="硫份上限" prop="sup" style="width:300px">
            <Input v-model="formData.sup" type="text"  />
          </FormItem>
          </Col>
          <Col :span="8">
          <FormItem label="硫份下限" prop="sdown" style="width:300px">
            <Input v-model="formData.sdown" type="text"  />
          </FormItem>
          </Col>
          <Col :span="8">
          <FormItem label="钒上限" prop="vup" style="width:300px">
            <Input v-model="formData.vup" type="text"  />
          </FormItem>
          </Col>
        </Row>
        <Row>
          <Col :span="24">
          <FormItem label="备注" prop="memo" style="width:913px">
            <Input v-model="formData.memo" type="textarea" height="200"/>
          </FormItem>
          </Col>
        </Row>

      </Form>
    </mmTable>
  </div>
</template>


<script>
  import mmTable from '../components/mmtable/mmtable.vue';
  export default {
    components: {
      mmTable
    },
    data () {
      /*显示列表*/
      return {
        columns:[
          {title: "编号",key: "code",width:200,align:'center'},
          {title: "方案名",key: "name",width:200,align:'center'},
          {title: "水份上限",key: "moistureup",width:200,align:'center'},
          {title: "挥发份上限",key: "volatileup",width:200,align:'center'},
          {title: "挥发份下限",key: "volatiledown",width:200,align:'center'},
          {title: "灰份上限",key: "ashup",width:200,align:'center'},
          {title: "硫份上限",key: "sup",width:200,align:'center'},
          {title: "硫份下限",key: "sdown",width:200,align:'center'},
          {title: "钒上限",key: "vup",width:200,align:'center'},
          {title: "备注",key: "memo",width:200,align:'center'}
        ],
        /*链接后台*/
        url:'/Reference/getList',
        updateUrl:'/Reference/Save',
        delUrl:'/Reference/Delete',
        form:{},
        formValidate:{
        },
        searchForm:{},
        searchFormData:{
          code:'',
          name:''
        },
        /*后台传的数据*/
        formData:{
          code:'',
          name:'',
          moistureup:'',
          volatileup:'',
          volatiledown:'',
          ashup:'',
          sup:'',
          sdown:'',
          vup:'',
          memo:'',
          id:''
        },
        searchFormData:{
          name:""
        },
        searchForm:{}
      }
    },
    mounted () {
      this.form = this.$refs.editForm;
      this.searchForm = this.$refs.searchForm;
    },
    /*方法*/
    methods: {
      formDataChange(data){
        this.formData = data;
      }
    }
  }
</script>
<style>

</style>
